import request from "@/utils/request";
// 引入接口调用后的参数或者返回值对应的接口类型
import type { LoginModel, UserInfoModel } from "./model/loginModel";

enum API {
  login = "/admin/acl/index/login", //登录地址
  logout = "/admin/acl/index/logout", //退出的地址
  getUserInfo = "/admin/acl/index/info", //获取用户信息的地址
}

//登录的api函数
export const reqLogin = (username: string, password: string) => {
  return request.post<any, LoginModel>(API.login, { username, password });
};
//退出的api函数
export const reqLogout = () => {
  return request.post<any, void>(API.logout);
};
//获取用户信息的api函数
export const reqUserInfo = () => {
  return request.get<any, UserInfoModel>(API.getUserInfo);
};
